using System;
using UnityEngine;

[Serializable]
public class stadiumselect : MonoBehaviour
{
	public AudioClip clip;

	public Color pressed;

	public Color unpressed;

	public Collider back;

	public Collider play;

	public Collider next;

	public string playload;

	public string nextcareer;

	public Camera mainCamera;

	private GUITexture gui;

	public stadiumselect()
	{
		playload = "arena1";
		nextcareer = "career2";
	}

	public void Start()
	{
		gui = (((GUITexture)GetComponent(typeof(GUITexture))) as GUITexture);
	}

	public void Update()
	{
		if (Input.GetMouseButtonUp(0))
		{
			st();
		}
		if (!Input.GetMouseButtonDown(0))
		{
			return;
		}
		RaycastHit hitInfo = default(RaycastHit);
		if (Physics.Raycast(mainCamera.ScreenPointToRay(UnityEngine.Input.mousePosition), out hitInfo, 100f))
		{
			if (hitInfo.collider.name == "Back")
			{
				AudioSource.PlayClipAtPoint(clip, Camera.main.transform.position);
				back.GetComponent<Renderer>().material.color = pressed;
				UnityEngine.SceneManagement.SceneManager.LoadScene("mainmenu2");
			}
			if (hitInfo.collider.name == "Play")
			{
				AudioSource.PlayClipAtPoint(clip, Camera.main.transform.position);
				play.GetComponent<Renderer>().material.color = pressed;
				UnityEngine.SceneManagement.SceneManager.LoadScene(playload);
			}
			if (hitInfo.collider.name == "Next")
			{
				AudioSource.PlayClipAtPoint(clip, Camera.main.transform.position);
				play.GetComponent<Renderer>().material.color = pressed;
				UnityEngine.SceneManagement.SceneManager.LoadScene(nextcareer);
			}
		}
	}

	public void st()
	{
		back.GetComponent<Renderer>().material.color = unpressed;
	}

	public void Main()
	{
	}
}
